package com.jhgsys.internal.common.exception;

import org.springframework.http.HttpStatus;

public class AppInterceptorException extends RuntimeException {

    /**
     * 消息编码
     */
    protected final HttpStatus code;

    /**
     * 异常消息
     */
    protected final String message;

    /**
     * 业务异常
     */
    public AppInterceptorException(HttpStatus httpStatus, String message) {
        this.code = httpStatus;
        this.message = message;
    }
    /**
     * 业务异常
     */
    public AppInterceptorException(String message) {
        this.code = HttpStatus.INTERNAL_SERVER_ERROR;
        this.message = message;
    }
    /**
     * 异常获取
     */
    @Override
    public String getMessage() {
        return message;
    }

    /**
     * 消息编码获取
     */
    public HttpStatus getCode() {
        return code;
    }

}

